
> #########################
> # Discounting Extreme Positions
> # Analysis and replication file
> # Laia Balcells, Sergi Martinez, and Ethan vanderWilden (corresponding author)
> # ethan.vanderwilden@wisc.edu
> 
> # Last replicated: November 26, 2024
> #########################
> 
> ############ 1. Load in packages and data ####
> # List of packages
> pkg = c("tidyverse", "gridExtra", "haven", "modelsummary", "mediation", "Hmisc", 
+         "collapse", "datawizard", "patchwork", "kableExtra", "vtable")

> # Checks if they are installed, install if not
> if (length(setdiff(pkg, rownames(installed.packages()))) > 0) {
+   install.packages(setdiff(pkg, rownames(installed.packages())))
+ }

> # Load
> suppressMessages(suppressWarnings(lapply(pkg, library, character.only = TRUE)))
[[1]]
 [1] "vtable"       "kableExtra"   "patchwork"    "datawizard"   "collapse"     "Hmisc"        "mediation"    "sandwich"     "mvtnorm"     
[10] "Matrix"       "MASS"         "modelsummary" "haven"        "gridExtra"    "lubridate"    "forcats"      "stringr"      "dplyr"       
[19] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"      "tidyverse"    "stats"        "graphics"     "grDevices"   
[28] "utils"        "datasets"     "methods"      "base"        

[[2]]
 [1] "vtable"       "kableExtra"   "patchwork"    "datawizard"   "collapse"     "Hmisc"        "mediation"    "sandwich"     "mvtnorm"     
[10] "Matrix"       "MASS"         "modelsummary" "haven"        "gridExtra"    "lubridate"    "forcats"      "stringr"      "dplyr"       
[19] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"      "tidyverse"    "stats"        "graphics"     "grDevices"   
[28] "utils"        "datasets"     "methods"      "base"        

[[3]]
 [1] "vtable"       "kableExtra"   "patchwork"    "datawizard"   "collapse"     "Hmisc"        "mediation"    "sandwich"     "mvtnorm"     
[10] "Matrix"       "MASS"         "modelsummary" "haven"        "gridExtra"    "lubridate"    "forcats"      "stringr"      "dplyr"       
[19] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"      "tidyverse"    "stats"        "graphics"     "grDevices"   
[28] "utils"        "datasets"     "methods"      "base"        

[[4]]
 [1] "vtable"       "kableExtra"   "patchwork"    "datawizard"   "collapse"     "Hmisc"        "mediation"    "sandwich"     "mvtnorm"     
[10] "Matrix"       "MASS"         "modelsummary" "haven"        "gridExtra"    "lubridate"    "forcats"      "stringr"      "dplyr"       
[19] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"      "tidyverse"    "stats"        "graphics"     "grDevices"   
[28] "utils"        "datasets"     "methods"      "base"        

[[5]]
 [1] "vtable"       "kableExtra"   "patchwork"    "datawizard"   "collapse"     "Hmisc"        "mediation"    "sandwich"     "mvtnorm"     
[10] "Matrix"       "MASS"         "modelsummary" "haven"        "gridExtra"    "lubridate"    "forcats"      "stringr"      "dplyr"       
[19] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"      "tidyverse"    "stats"        "graphics"     "grDevices"   
[28] "utils"        "datasets"     "methods"      "base"        

[[6]]
 [1] "vtable"       "kableExtra"   "patchwork"    "datawizard"   "collapse"     "Hmisc"        "mediation"    "sandwich"     "mvtnorm"     
[10] "Matrix"       "MASS"         "modelsummary" "haven"        "gridExtra"    "lubridate"    "forcats"      "stringr"      "dplyr"       
[19] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"      "tidyverse"    "stats"        "graphics"     "grDevices"   
[28] "utils"        "datasets"     "methods"      "base"        

[[7]]
 [1] "vtable"       "kableExtra"   "patchwork"    "datawizard"   "collapse"     "Hmisc"        "mediation"    "sandwich"     "mvtnorm"     
[10] "Matrix"       "MASS"         "modelsummary" "haven"        "gridExtra"    "lubridate"    "forcats"      "stringr"      "dplyr"       
[19] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"      "tidyverse"    "stats"        "graphics"     "grDevices"   
[28] "utils"        "datasets"     "methods"      "base"        

[[8]]
 [1] "vtable"       "kableExtra"   "patchwork"    "datawizard"   "collapse"     "Hmisc"        "mediation"    "sandwich"     "mvtnorm"     
[10] "Matrix"       "MASS"         "modelsummary" "haven"        "gridExtra"    "lubridate"    "forcats"      "stringr"      "dplyr"       
[19] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"      "tidyverse"    "stats"        "graphics"     "grDevices"   
[28] "utils"        "datasets"     "methods"      "base"        

[[9]]
 [1] "vtable"       "kableExtra"   "patchwork"    "datawizard"   "collapse"     "Hmisc"        "mediation"    "sandwich"     "mvtnorm"     
[10] "Matrix"       "MASS"         "modelsummary" "haven"        "gridExtra"    "lubridate"    "forcats"      "stringr"      "dplyr"       
[19] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"      "tidyverse"    "stats"        "graphics"     "grDevices"   
[28] "utils"        "datasets"     "methods"      "base"        

[[10]]
 [1] "vtable"       "kableExtra"   "patchwork"    "datawizard"   "collapse"     "Hmisc"        "mediation"    "sandwich"     "mvtnorm"     
[10] "Matrix"       "MASS"         "modelsummary" "haven"        "gridExtra"    "lubridate"    "forcats"      "stringr"      "dplyr"       
[19] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"      "tidyverse"    "stats"        "graphics"     "grDevices"   
[28] "utils"        "datasets"     "methods"      "base"        

[[11]]
 [1] "vtable"       "kableExtra"   "patchwork"    "datawizard"   "collapse"     "Hmisc"        "mediation"    "sandwich"     "mvtnorm"     
[10] "Matrix"       "MASS"         "modelsummary" "haven"        "gridExtra"    "lubridate"    "forcats"      "stringr"      "dplyr"       
[19] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"      "tidyverse"    "stats"        "graphics"     "grDevices"   
[28] "utils"        "datasets"     "methods"      "base"        


> rm(list=ls())

> setwd("C:/Users/19785/Dropbox/Ethan Sergi Laia/REPLICATION")

> data <- read_sav("DiscountingData.sav")

> ############ 2. Write 'Helper' Functions  ####
> # A. Get graphable coefficients for interaction model
> # INPUT: Function takes in a dataset, the relevant outcome/dependent variable,
> # the extreme position (LGBTQ or history), and whether control variables should be included in the model
> # OUTPUT: Function outputs a dataframe with main coefficients and standard errors (easy to graph)
> get_coefs <- function(data, DV = "sympathy", issue, controls = F){
+   
+   # If history issue, get regression, add results to the formatted output dataframe
+   if(issue == "History"){
+     if(controls == F){ myreg <- coef(summary(lm(scale(get(DV)) ~ normal + history + history*normal,  data = subset(data, data$treat %in% c(0:3)))))} 
+     else {myreg <- coef(summary(lm(scale(get(DV)) ~ normal + history + history*normal + 
+                                      age + sex + education + working + income + household_residents + pol_know + factor(region),
+                                    data = s .... [TRUNCATED] 

> # B. Get coefficient plot for main regression models
> # INPUT: graphable coefficients (from get_coefs()), plus additional  graph specs
> # OUTPUT: ggplot object with coefficient plot
> coef_plot <- function(data, plot_title, axis_title = "\nStandardized effect", range = 0.5, jump = 0.25){
+   
+   #Ensure order of comparison stays consistent
+   data$outcomes <- factor(data$outcomes, levels = data$outcomes)
+   
+   #plot 90 and 95% confidence intervals and coefficient point estimates
+   myplot <- ggplot(data = data) +
+     aes(x = estimate, y = outcomes) +
+     geom_vline(xintercept = 0, size = 0.5)+
+     geom_pointrange(aes(xmin= estimate-1.96*se, xmax= estimate+1.96*se), 
+                     shape = 21, size = 0.8, linewidth = 1.8) +
+     geom_pointrange(aes(xmin= estimate-1.645*se, xmax= estimate+1.645*se), 
+                     shape = 21, size = 1.5, linewidth = 4, fill = "grey") +
+     labs(x = axis_title,
+          title = plot_title) +
+     theme_bw()+
+     them .... [TRUNCATED] 

> # C. Heterogeneous Splits
> # INPUT: data subsets (ex: moderates and extremists), name of each dataset,
> # outcome/dependent variable, extreme position (LGBTQ or history), and additional graph specs
> # OUTPUT: ggplot object with coefficient plot separating results by heterogeneous sub-sample
> het_splits <- function(data1, data2, name1, name2, dv = "sympathy", issue, plot_title, 
+                        axis_title = "\nStandarized effect on sympathy for Vox", range = 0.5, jump = 0.25){
+   
+   #Get results for each subset-group
+   results <- rbind(cbind(get_coefs(data1, DV = dv, issue = issue), group = rep(name1, 3)),
+                   cbind(get_coefs(data2, DV = dv, issue = issue), group = rep(name2, 3)))
+   
+   ### Make plot
+   results$outcomes <- factor(results$outcomes, levels = results$outcomes[1:3])
+   results$group <- factor(results$group, levels = results$group[c(1, 4)])
+ 
+   #plot 90 and 95% confidence intervals and coefficient point estimates
+   myplot <- ggpl .... [TRUNCATED] 

> # D. Get coefficient plot for multiple outcomes (Sympathy, Ever Vote, Voting Vox) plot
> # INPUT: dataset, extreme position (LGBTQ or history), graph spects
> # OUTPUT: ggplot object with coefficient plot for multiple outcomes related to Vox
> triple_outcomes <- function(data, issue, plot_title, axis_title = "\nStandarized effect on (outcome denoted in legend)", 
+                             range = 0.5, jump = 0.25){
+   
+   #Get results
+   results <- rbind( get_coefs(data, DV = "sympathy", issue = issue),  get_coefs(data, DV = "ever_vote", issue = issue),
+     get_coefs(data, DV = "voteVox", issue = issue) )
+   
+   results$dv <- c(rep("Sympathy \n for Vox (0:100)", 3),  rep("Ever vote \n for Vox (1:5)", 3),  rep("Voting \n for Vox (0/1)", 3))
+   
+   
+   ### Make plot
+   results$outcomes <- factor(results$outcomes, levels = results$outcomes[1:3])
+   results$dv <- factor(results$dv, levels = results$dv[c(1, 4, 7)])
+   
+   #plot 90 and 95% confidence intervals and coeffic .... [TRUNCATED] 

> ############ 3. Main Results ####
> 
> ### Figure 1 - LGBTQ results (render at 1400 x 500)
> coef_plot(get_coefs(data, issue = "LGBTQ"), 
+           "A. Sympathy for Vox", "\nStandardized effect on sympathy for Vox") +
+ coef_plot(get_coefs(data, DV = "M2.VoxHostile", issue = "LGBTQ"),
+           "B. Vox is hostile towards LGBTQ+ people", "\nStandardized effect on perceptions of Vox authenticity") + 
+   theme(axis.text.y = element_blank(), axis.ticks.y = element_blank())

> ### Figure 2 - Pro-Franco statement results (render at 1400 x 500)
> coef_plot(get_coefs(data, issue = "History"), 
+           "A. Sympathy for Vox", "\nStandardized effect on sympathy for Vox") +
+ coef_plot(get_coefs(data, DV = "M1.VoxReinstall", issue = "History"), 
+           "B. Vox wants to re-install dictatorship", "\nStandardized effect on perceptions of Vox authenticity")+ 
+   theme(axis.text.y = element_blank(), axis.ticks.y = element_blank())

> ### Figure 3 - differences between 'moderates' and 'extremists' (render at 1600 x 500)
> het_splits(subset(data, data$ideology < 8), subset(data, data$ideology > 7), "Moderates (5:7)", "Far Right (8:10)",
+            issue = "LGBTQ", plot_title = "A. Priming Anti-LGBTQ Statements") + 
+ het_splits(subset(data, data$ideology < 8), subset(data, data$ideology > 7), "Moderates (5:7)", "Far Right (8:10)",
+            issue = "History", plot_title = "B. Priming Pro-Franco Statements")

> ############## 4. Appendix ####
> 
> #### A.1.1 Demographic representativeness ####
> 
> #Because demographic categories are categorical, we have to convert data into binaries
> repdata <- data #save data as new object

> #Get percentages for each variable
> repdata$M1 <- data$sex

> repdata$AG1 <- ifelse(repdata$age %in% c(18:25), 1, 0)

> repdata$AG2 <- ifelse(repdata$age %in% c(26:35), 1, 0)

> repdata$AG3 <- ifelse(repdata$age %in% c(36:45), 1, 0)

> repdata$AG4 <- ifelse(repdata$age %in% c(46:55), 1, 0)

> repdata$AG5 <- ifelse(repdata$age %in% c(56:65), 1, 0)

> repdata$AG6 <- ifelse(repdata$age >65, 1, 0)

> repdata$R1 <- ifelse(repdata$region == 1, 1, 0) #Andalucia

> repdata$R2 <- ifelse(repdata$region == 2, 1, 0) #Aragon

> repdata$R3 <- ifelse(repdata$region == 3, 1, 0) #Asturias

> repdata$R4 <- ifelse(repdata$region == 4, 1, 0) #Islas Baleares

> repdata$R5 <- ifelse(repdata$region == 5, 1, 0) #Islas Canarias

> repdata$R6 <- ifelse(repdata$region == 6, 1, 0) #Cantabria

> repdata$R7 <- ifelse(repdata$region == 8, 1, 0) #note: swapped in INE data, so make Castilla y Leon 8th

> repdata$R8 <- ifelse(repdata$region == 7, 1, 0) #Castilla la Mancha

> repdata$R9 <- ifelse(repdata$region == 9, 1, 0) #Catalunya

> repdata$R10 <- ifelse(repdata$region == 10, 1, 0) #Valencia

> repdata$R11 <- ifelse(repdata$region == 11, 1, 0) #Extremadura is 11

> repdata$R12 <- ifelse(repdata$region == 12, 1, 0) #Galicia

> repdata$R13 <- ifelse(repdata$region == 13, 1, 0) #Madrid

> repdata$R14 <- ifelse(repdata$region == 14, 1, 0) #Murcia

> repdata$R15 <- ifelse(repdata$region == 15, 1, 0) #Navarra

> repdata$R16 <- ifelse(repdata$region == 16, 1, 0) #Pais Vasco

> repdata$R17 <- ifelse(repdata$region == 17, 1, 0) #La Rioja

> #Set up dataframe to store INE statistics + sample statistics
> #On gender; age group; and region
> rep.tab <- data.frame(
+   row.names = c("Male", "18-25", "26-35", "36-45", "46-55", "56-65", "66+",
+                 "Andalucía", "Aragón", "Asturias", "las Islas Baleares", "las Islas Canarias",
+                 "Cantabria", "Castilla y León", "Castilla-La Mancha", "Catalunya", "Valencia",
+                 "Extremadura", "Galicia", "Madrid", "Murcia", "Navarra", "País Vasco", "La Rioja"),
+   
+   sample.prop = rep(NA, 24), 
+   census.prop = c(0.490, 0.097, 0.131, 0.169, 0.187, 0.158, 0.256,
+                   0.179, 0.028, 0.021, 0.025, 0.046, 0.012, 0.050, 0.043,
+                   0.165, 0.109, 0.022, 0.056, 0.143, 0.032, 0.014, 0.046, 0.007),
+   difference = rep(NA, 24),
+   p.value = rep(NA, 24)
+ )

> #For eadh variable, gather sample proportion, difference from INE; and p-value for t.test
> for (i in 1:24){
+   rep.tab$sample.prop[i] <- round(mean(repdata[, i+33][[1]], na.rm = T), 3)
+   rep.tab$difference[i] <- round(abs(rep.tab$sample.prop[i] - rep.tab$census.prop[i]), 3)
+   rep.tab$p.value[i] <- round(t.test(repdata[,i+33], mu = rep.tab$census.prop[i], alternative = 'two.sided')$p.value, 3)
+ }

> #Print table (latex)
> kbl(rep.tab, format = 'latex', booktabs = T)

\begin{tabular}[t]{lrrrr}
\toprule
  & sample.prop & census.prop & difference & p.value\\
\midrule
Male & 0.484 & 0.490 & 0.006 & 0.431\\
18-25 & 0.063 & 0.097 & 0.034 & 0.000\\
26-35 & 0.130 & 0.131 & 0.001 & 0.834\\
36-45 & 0.187 & 0.169 & 0.018 & 0.003\\
46-55 & 0.206 & 0.187 & 0.019 & 0.002\\
\addlinespace
56-65 & 0.169 & 0.158 & 0.011 & 0.056\\
66+ & 0.246 & 0.256 & 0.010 & 0.108\\
Andalucía & 0.180 & 0.179 & 0.001 & 0.800\\
Aragón & 0.029 & 0.028 & 0.001 & 0.789\\
Asturias & 0.022 & 0.021 & 0.001 & 0.559\\
\addlinespace
las Islas Baleares & 0.026 & 0.025 & 0.001 & 0.627\\
las Islas Canarias & 0.046 & 0.046 & 0.000 & 0.878\\
Cantabria & 0.014 & 0.012 & 0.002 & 0.345\\
Castilla y León & 0.054 & 0.050 & 0.004 & 0.276\\
Castilla-La Mancha & 0.043 & 0.043 & 0.000 & 0.879\\
\addlinespace
Catalunya & 0.149 & 0.165 & 0.016 & 0.002\\
Valencia & 0.111 & 0.109 & 0.002 & 0.630\\
Extremadura & 0.024 & 0.022 & 0.002 & 0.411\\
Galicia & 0.058 & 0.056 & 0.002 & 0.522\\
Madrid & 0.148 & 0.143 & 0.005 & 0.315\\
\addlinespace
Murcia & 0.033 & 0.032 & 0.001 & 0.592\\
Navarra & 0.014 & 0.014 & 0.000 & 0.947\\
País Vasco & 0.039 & 0.046 & 0.007 & 0.012\\
La Rioja & 0.008 & 0.007 & 0.001 & 0.577\\
\bottomrule
\end{tabular}

> #### A.1.1 Comparing to sample demographics to CIS ####
> 
> #Load in CIS data, September 2023 (3420)
> MD3420 <- read_sav("additional_data/cis2023sept3420.sav")
Invalid date string (length=9): 07 033 23

> #Clean data and make numeric [codebook in replication files]
> MD3420$educacion <- as.numeric(MD3420$NIVELESTENTREV)

> MD3420$educacion <- ifelse(MD3420$educacion==98, NA, MD3420$educacion)

> MD3420$sexo <- (as.numeric(MD3420$SEXO)-1)

> MD3420$ingresos <- as.numeric(MD3420$INGRESHOG)

> MD3420$working <- ifelse(MD3420$SITLAB==1 | MD3420$SITLAB==7 | MD3420$SITLAB==8, 1, 0)

> ## TABLE A2 - full sample
> suppressWarnings(sumtable(MD3420, vars = c("sexo", "EDAD", "educacion", "working"),
+                           labels = c("Gender", "Age", "Education", "Working"), out='latex'))
\begin{table}[!htbp] \centering \renewcommand*{\arraystretch}{1.1}\caption{Summary Statistics}\resizebox{\textwidth}{!}{
\begin{tabular}{lrrrrrrr}
\hline
\hline
Variable & N & Mean & Std. Dev. & Min & Pctl. 25 & Pctl. 75 & Max \\ 
\hline
Gender & 10101 & 0.5 & 0.5 & 0 & 0 & 1 & 1 \\ 
Age & 10101 & 51 & 17 & 18 & 39 & 63 & 98 \\ 
Education & 9989 & 8.1 & 3.5 & 1 & 6 & 11 & 16 \\ 
Working & 10101 & 0.62 & 0.48 & 0 & 0 & 1 & 1\\ 
\hline
\hline
\end{tabular}
}
\end{table}

> ## TABLE A3 - right-only subsample
> suppressWarnings(sumtable(MD3420[MD3420$ESCIDEOL>4 & MD3420$ESCIDEOL<12,], 
+                          vars = c("sexo", "EDAD", "educacion", "working"),
+                          labels = c("Gender", "Age", "Education", "Working"), out='latex'))
\begin{table}[!htbp] \centering \renewcommand*{\arraystretch}{1.1}\caption{Summary Statistics}\resizebox{\textwidth}{!}{
\begin{tabular}{lrrrrrrr}
\hline
\hline
Variable & N & Mean & Std. Dev. & Min & Pctl. 25 & Pctl. 75 & Max \\ 
\hline
Gender & 5160 & 0.48 & 0.5 & 0 & 0 & 1 & 1 \\ 
Age & 5160 & 52 & 17 & 18 & 40 & 64 & 98 \\ 
Education & 5109 & 7.9 & 3.5 & 1 & 5 & 11 & 16 \\ 
Working & 5160 & 0.63 & 0.48 & 0 & 0 & 1 & 1\\ 
\hline
\hline
\end{tabular}
}
\end{table}

> #### A.1.3 Descriptive statistics Table ####
> 
> 
> #Store variable names needed for descriptive statistics
> variables <- c('sympathy', 'ever_vote', 'voteVox', 'M1.VoxReinstall', 'M2.VoxHostile',
+                'vote_guess', 'coalition.manip',
+                'sex', 'age', 'education', 'household_residents', 'income', 'working', 
+                'SP_nationalism', 'CCAA_nationalism', 'ideology', 'pol_know')

> # TABLE A4 (latex)
> sumtable(data, vars = variables, labels = variables,
+          numformat = formatfunc(digits = 2, nsmall = 2, big.mark = ','), out = 'latex')
\begin{table}[!htbp] \centering \renewcommand*{\arraystretch}{1.1}\caption{Summary Statistics}\resizebox{\textwidth}{!}{
\begin{tabular}{lrrrrrrr}
\hline
\hline
Variable & N & Mean & Std. Dev. & Min & Pctl. 25 & Pctl. 75 & Max \\ 
\hline
sympathy & 4,377 & 43.01 & 34.12 & 0.00 & 8.00 & 71.00 & 100.00 \\ 
ever\_vote & 4,371 & 2.53 & 1.41 & 1.00 & 1.00 & 4.00 & 5.00 \\ 
voteVox & 4,345 & 0.18 & 0.38 & 0.00 & 0.00 & 0.00 & 1.00 \\ 
M1.VoxReinstall & 4,315 & 2.38 & 1.32 & 1.00 & 1.00 & 3.00 & 5.00 \\ 
M2.VoxHostile & 4,315 & 3.28 & 1.31 & 1.00 & 2.00 & 4.00 & 5.00 \\ 
vote\_guess & 4,279 & 17.85 & 10.35 & 1.00 & 11.00 & 21.00 & 42.00 \\ 
coalition.manip & 4,315 & 3.32 & 1.15 & 1.00 & 3.00 & 4.00 & 5.00 \\ 
sex & 4,390 & 0.48 & 0.50 & 0.00 & 0.00 & 1.00 & 1.00 \\ 
age & 4,402 & 51.10 & 15.70 & 18.00 & 39.00 & 65.00 & 80.00 \\ 
education & 4,362 & 5.17 & 1.32 & 1.00 & 4.00 & 6.00 & 8.00 \\ 
household\_residents & 4,356 & 2.76 & 1.12 & 1.00 & 2.00 & 4.00 & 8.00 \\ 
income & 4,335 & 6.01 & 1.53 & 1.00 & 5.00 & 7.00 & 9.00 \\ 
working & 4,371 & 0.54 & 0.50 & 0.00 & 0.00 & 1.00 & 1.00 \\ 
SP\_nationalism & 4,402 & 8.30 & 2.34 & 0.00 & 7.00 & 10.00 & 10.00 \\ 
CCAA\_nationalism & 4,402 & 7.73 & 2.75 & 0.00 & 6.00 & 10.00 & 10.00 \\ 
ideology & 4,402 & 6.55 & 1.63 & 5.00 & 5.00 & 8.00 & 10.00 \\ 
pol\_know & 4,394 & 0.57 & 0.49 & 0.00 & 0.00 & 1.00 & 1.00\\ 
\hline
\hline
\end{tabular}
}
\end{table}

> #### A.1.3 Outcome distributions ####
> 
> ## FIGURE A2 (a, b, c) - Vox affinities
> #Get means for graph labels
> mean(data$sympathy, na.rm = T) #43.01
[1] 43.01371

> mean(data$ever_vote, na.rm = T) #2.53
[1] 2.527111

> mean(data$voteVox, na.rm = T) #0.178
[1] 0.1781358

> #Vox support
> sym <- ggplot(data = data) +
+   geom_histogram(aes(x = sympathy), color = "black", fill = "darkgreen", alpha = 0.7, bins = 25) +
+   theme_bw() + geom_vline(xintercept = 43.01, color = "black") +
+   labs(title = "Sympathy for Vox (Mean response: 43.01)", x = "Sympathy score", y = "Frequency") +
+   scale_x_continuous(limits = c(-5, 105), breaks = seq(0, 100, 10)) +
+   theme(text = element_text(size = 12), plot.title = element_text(size = 16, face = 'bold', hjust = 0.5),
+         panel.grid = element_blank())

> ever <- ggplot(data = data) +
+   geom_bar(aes(x = ever_vote), color = "black", fill = "darkgreen", alpha = 0.7) +
+   theme_bw() + geom_vline(xintercept = 2.53, color = "black") +
+   labs(title = "Consider ever voting Vox (Mean response: 2.53)", 
+        x = "1 = Never vote Vox, 5 = Will definitely vote Vox in the future", y = "Frequency") +
+   scale_x_continuous(limits = c(0.49, 5.51), breaks = seq(1, 5, 1)) +
+   theme(text = element_text(size = 12), plot.title = element_text(size = 16, face = 'bold', hjust = 0.5),
+         panel.grid = element_blank())

> vote <- ggplot(data = data) +
+   geom_bar(aes(x = voteVox), color = "black", fill = "darkgreen", alpha = 0.7) +
+   theme_bw() + labs(title = "Planning to vote Vox (Mean response: 0.178)", 
+                     x = "0 = Other party/no Vote, 1 = Voting Vox", y = "Frequency") +
+   scale_x_continuous(limits = c(-0.49, 1.51), breaks = seq(0, 1, 1)) +
+   theme(text = element_text(size = 12), plot.title = element_text(size = 16, face = 'bold', hjust = 0.5),
+         panel.grid = element_blank())

> #render figure A2 (1650 x 450)
> sym + ever + vote

> ## FIGURE A3 (a, b) - authenticity
> #Get means for graph labels
> mean(data$M2.VoxHostile, na.rm = T) # 3.28
[1] 3.27949

> mean(data$M1.VoxReinstall, na.rm = T) # 2.38
[1] 2.380533

> #Vox is hoslite towards LGBTQ+ community
> hostileLBGTQ <- ggplot(data = data) +
+   geom_bar(aes(x = M2.VoxHostile), color = "black", fill = "darkgreen", alpha = 0.7) +
+   theme_bw() + geom_vline(xintercept = 3.28, color = "black") +
+   labs(title = "Vox is hostile to LGBTQ+ people (Mean response: 3.28)", 
+        x = "1 = Strongly disagree, 5 = Strongly agree", y = "Frequency") +
+   scale_x_continuous(limits = c(0.49, 5.51), breaks = seq(1, 5, 1)) +
+   theme(text = element_text(size = 12), plot.title = element_text(size = 16, face = 'bold', hjust = 0.5),
+         panel.grid = element_blank())

> #Vox would re-install dictatorship
> reinstall <- ggplot(data = data) +
+   geom_bar(aes(x = M1.VoxReinstall), color = "black", fill = "darkgreen", alpha = 0.7) +
+   theme_bw() + geom_vline(xintercept = 2.38, color = "black") +
+   labs(title = "Vox would re-install dictatorship (Mean response: 2.38)",
+        x = "1 = Strongly disagree, 5 = Strongly agree", y = "Frequency") +
+   scale_x_continuous(limits = c(0.49, 5.51), breaks = seq(1, 5, 1)) +
+   theme(text = element_text(size = 12), plot.title = element_text(size = 16, face = 'bold', hjust = 0.5),
+         panel.grid = element_blank())

> #Render figure A3 (1250 x 450)
> hostileLBGTQ + reinstall

> #### A.1.4 Balance Tables ####
> 
> #Save variables (pre-treatment) for balance checks
> variables <- c('sex', 'age', 'education', 'household_residents', 'income', 'working', 
+                'SP_nationalism', 'CCAA_nationalism', 'ideology', 'pol_know')

> #Create dataframe to store results
> results <- data.frame("Variable" = variables, "Low" = rep(NA, length(variables)),
+                       "High" = rep(NA, length(variables)), "SC" = rep(NA, length(variables)),
+                       "NC" = rep(NA, length(variables)), "SH" = rep(NA, length(variables)),
+                       "NH" = rep(NA, length(variables)), "SL" = rep(NA, length(variables)),
+                       "NL" = rep(NA, length(variables)), "ANOVA" = rep(NA, length(variables)))

> #for each variable, record range, means, and anova p-value for balance across treatment arms
> for (i in 1:length(variables)){
+   info <- c()
+   info <- append(info, range(data[, c(variables[i])][[1]], na.rm = T)) # range
+   for(j in 0:5){info <- append(info, mean(subset(data, treat == j)[ , c(variables[i])][[1]], na.rm = T))} #means
+   info <- append(info, as.numeric(anova(lm(get(variables[i]) ~ factor(treat), data = data))[1,5])) # ANOVA p-value
+   
+   results[i, 2:10] <- info
+ }

> #Round numeric results
> results[,2:10] <- round(results[, 2:10], 3)

> #TABLE A5 - Print results
> kbl(results, format = 'latex', booktabs = T)

\begin{tabular}[t]{lrrrrrrrrr}
\toprule
Variable & Low & High & SC & NC & SH & NH & SL & NL & ANOVA\\
\midrule
sex & 0 & 1 & 0.513 & 0.480 & 0.482 & 0.485 & 0.458 & 0.462 & 0.423\\
age & 18 & 80 & 50.945 & 50.901 & 51.303 & 51.206 & 50.741 & 51.501 & 0.968\\
education & 1 & 8 & 5.203 & 5.165 & 5.141 & 5.194 & 5.230 & 5.094 & 0.612\\
household\_residents & 1 & 8 & 2.759 & 2.719 & 2.818 & 2.734 & 2.790 & 2.714 & 0.427\\
income & 1 & 9 & 5.933 & 6.024 & 5.997 & 5.995 & 6.089 & 6.071 & 0.522\\
\addlinespace
working & 0 & 1 & 0.520 & 0.545 & 0.549 & 0.537 & 0.544 & 0.535 & 0.866\\
SP\_nationalism & 0 & 10 & 8.431 & 8.279 & 8.294 & 8.249 & 8.215 & 8.295 & 0.574\\
CCAA\_nationalism & 0 & 10 & 7.807 & 7.731 & 7.769 & 7.688 & 7.677 & 7.620 & 0.858\\
ideology & 5 & 10 & 6.562 & 6.486 & 6.641 & 6.535 & 6.545 & 6.539 & 0.518\\
pol\_know & 0 & 1 & 0.578 & 0.561 & 0.588 & 0.555 & 0.561 & 0.591 & 0.638\\
\bottomrule
\end{tabular}

> #### A.2.1 Manipulation checks ####
> 
> #create dataframe to store results
> results <- data.frame( outcomes = c("Perceived accept-\nability of coalitions\n(effect of 'normalized')", 
+                                     "Vote approx. for Vox\n(effect of 'normalized')", 
+                                     "Vox is hostile\ntowards LGBTQ+ people\n(effect of anti-LGBTQ+ statement)", 
+                                     "Vox would re-install autocracy\n(effect of pro-Franco statement)"),
+                estimate = rep(NA, 4), se = rep(NA, 4))

> #A. Normalization (keep main effect of normalized)
> results[1, 2:3] <- coef(summary(lm(scale(coalition.manip) ~ normal + lgbtq + history +
+                                      lgbtq*normal + history*normal, data = data)))[2, 1:2]

> results[2, 2:3] <- coef(summary(lm(scale(vote_guess) ~ normal + lgbtq + history + 
+                                      lgbtq*normal + history*normal, data = data)))[2, 1:2]

> #B. LGBT (keep main effects of LGBTQ statement)
> results[3, 2:3] <- coef(summary(lm(scale(M2.VoxHostile) ~ lgbtq + normal + normal*lgbtq, 
+                                    data = subset(data, data$treat %in% c(0:1, 4:5)))))[2, 1:2]

> #C. Authoritarian history (keep main effect of History statement)
> results[4, 2:3] <- coef(summary(lm(scale(M1.VoxReinstall) ~ history  + normal + history*normal, 
+                                    data = subset(data, data$treat %in% c(0:3)))))[2, 1:2]

> ## Render Figure A4 (900 x 550)
> coef_plot(results, "Manipulation Checks", "\nStandardized effect of relevant manipulation") +
+   theme(axis.text.y = element_text(face = 'plain'))

> #### A.2.2 Did party normalization normalize the issue positions? ####
> 
> #Check if normalization prime led to change on expression of issue support 
> # NOTE: control group, no issue prime
> mod1 <- summary(lm(M3.FrancoGood ~ normal, data = subset(data, data$treat %in% c(0:1))))

> mod2 <- summary(lm(M4.DoMoreLGBTQ ~ normal, data = subset(data, data$treat %in% c(0:1))))

> #TABLE A6 - print regression outputs (cleaned up in paper)
> suppressWarnings(modelsummary(list(mod1, mod2), output = 'latex', stars = T))
\begin{table}
\centering
\begin{talltblr}[         %% tabularray outer open
entry=none,label=none,
note{}={+ p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001},
]                     %% tabularray outer close
{                     %% tabularray inner open
colspec={Q[]Q[]Q[]},
column{1}={halign=l,},
column{2}={halign=c,},
column{3}={halign=c,},
hline{6}={1,2,3}{solid, 0.05em, black},
}                     %% tabularray inner close
\toprule
& (1) & (2) \\ \midrule %% TinyTableHeader
(Intercept) & \num{3.199}*** & \num{3.180}*** \\
& (\num{0.039})  & (\num{0.040})  \\
normal      & \num{-0.091}+  & \num{0.074}    \\
& (\num{0.055})  & (\num{0.056})  \\
Num.Obs.    & \num{1711}     & \num{1712}     \\
R2          & \num{0.002}    & \num{0.001}    \\
R2 Adj.     & \num{0.001}    & \num{0.000}    \\
RMSE        & \num{1.14}     & \num{1.16}     \\
\bottomrule
\end{talltblr}
\end{table} 

> #### A.2.3 Tabular results from main figures ####
> #Make treatment assignment for Vox statement a factor variable
> data$position <- factor(data$position, levels = c('null', 'lgbtq', 'history'))

> #Record main regressions
> main <- summary(lm(sympathy ~ position + normal + position*normal, data = data))

> mL <-summary(lm(M2.VoxHostile ~ position + normal + position*normal, data = subset(data, position != 'history')))

> mH <-summary(lm(M1.VoxReinstall ~ position + normal + position*normal, data = subset(data, position != 'lgbtq')))

> mods <- summary(lm(sympathy ~ position + normal + position*normal, data = subset(data, ideology <8)))

> exts <- summary(lm(sympathy ~ position + normal + position*normal, data = subset(data, ideology >7)))

> #TABLE A7 - print regressions, cleaned up in paper
> suppressWarnings(modelsummary(list(main, mL, mH, mods, exts), stars = T, output = 'latex', booktabs = F))
\begin{table}
\centering
\begin{talltblr}[         %% tabularray outer open
entry=none,label=none,
note{}={+ p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001},
]                     %% tabularray outer close
{                     %% tabularray inner open
colspec={Q[]Q[]Q[]Q[]Q[]Q[]},
column{1}={halign=l,},
column{2}={halign=c,},
column{3}={halign=c,},
column{4}={halign=c,},
column{5}={halign=c,},
column{6}={halign=c,},
hline{14}={1,2,3,4,5,6}{solid, 0.05em, black},
}                     %% tabularray inner close
\toprule
& (1) & (2) & (3) & (4) & (5) \\ \midrule %% TinyTableHeader
(Intercept)              & \num{44.197}*** & \num{3.192}*** & \num{2.276}*** & \num{33.244}*** & \num{70.340}*** \\
& (\num{1.158})   & (\num{0.046})  & (\num{0.045})  & (\num{1.193})   & (\num{1.852})   \\
positionlgbtq            & \num{-5.550}**  & \num{0.171}*   &                 & \num{-6.287}**  & \num{-5.211}    \\
& (\num{2.010})   & (\num{0.079})  &                 & (\num{2.082})   & (\num{3.175})   \\
positionhistory          & \num{-1.182}    &                 & \num{0.130}*   & \num{-1.946}    & \num{-1.435}    \\
& (\num{1.635})   &                 & (\num{0.064})  & (\num{1.695})   & (\num{2.580})   \\
normal                   & \num{-0.410}    & \num{0.078}    & \num{0.110}+   & \num{-0.980}    & \num{2.234}     \\
& (\num{1.636})   & (\num{0.064})  & (\num{0.064})  & (\num{1.680})   & (\num{2.637})   \\
positionlgbtq × normal   & \num{6.064}*    & \num{-0.241}*  &                 & \num{8.979}**   & \num{-0.730}    \\
& (\num{2.828})   & (\num{0.111})  &                 & (\num{2.917})   & (\num{4.506})   \\
positionhistory × normal & \num{-0.031}    &                 & \num{-0.102}   & \num{1.466}     & \num{-2.658}    \\
& (\num{2.306})   &                 & (\num{0.090})  & (\num{2.378})   & (\num{3.679})   \\
Num.Obs.                 & \num{4377}      & \num{2576}     & \num{3450}     & \num{3075}      & \num{1302}      \\
R2                       & \num{0.002}     & \num{0.002}    & \num{0.002}    & \num{0.004}     & \num{0.006}     \\
R2 Adj.                  & \num{0.001}     & \num{0.001}    & \num{0.001}    & \num{0.003}     & \num{0.002}     \\
RMSE                     & \num{34.08}     & \num{1.33}     & \num{1.31}     & \num{29.47}     & \num{29.56}     \\
\bottomrule
\end{talltblr}
\end{table} 

> #### A.2.4 Examining more outcomes related to Vox ####
> 
> # Figure A5 render at 1600 x 500
> triple_outcomes(data, issue = "LGBTQ", plot_title = "A. Normalization and anti-LGBTQ+ statements") +
+ triple_outcomes(data, issue = "History", plot_title = "B. Normalization and pro-Franco statements")

> #### A.2.5 Additional analyses for Moderates and extremists ####
> 
> # Figure A6, Mechanisms (discounted authenticity): render at 1600 x 500
> het_splits(subset(data, data$ideology < 8), subset(data, data$ideology > 7), "Moderates (5:7)", "Far Right (8:10)",
+            dv = "M2.VoxHostile", issue = "LGBTQ", plot_title = "A. Priming Anti-LGBTQ+ Statements",
+            axis_title = "\nStandarized effect on perceptions of Vox authenticity") +
+ het_splits(subset(data, data$ideology < 8), subset(data, data$ideology > 7), "Moderates (5:7)", "Far Right (8:10)",
+            dv = "M1.VoxReinstall", issue = "History", plot_title = "B. Priming Pro-Franco Statements",
+            axis_title = "\nStandarized effect on perceptions of Vox authenticity")

> # Figure A7, Alternative cutoff points: render at 1600 x 500
> het_splits(subset(data, data$ideology < 9), subset(data, data$ideology > 8), "Moderates (5:8)", "Far Right (9:10)",
+            issue = "LGBTQ", plot_title = "A. Priming Anti-LGBTQ+ Statements", range = 0.6, jump = 0.3) +
+ het_splits(subset(data, data$ideology < 9), subset(data, data$ideology > 8), "Moderates (5:8)", "Far Right (9:10)",
+                          issue = "History", plot_title = "B. Priming Pro-Franco Statements", range = 0.6, jump = 0.3)

> # Figure A8, Vox and Non-vox voters: render at 1600 x 500
> het_splits(subset(data, data$voteVox == 0), subset(data, data$voteVox == 1), "Non-Vox voters", "Vox voters",
+            dv = "sympathy", issue = "LGBTQ", plot_title = "A. Priming Anti-LGBTQ+ Statements", range = 0.54) +
+ het_splits(subset(data, data$voteVox == 0), subset(data, data$voteVox == 1), "Non-Vox voters", "Vox voters",
+                          dv = "sympathy", issue = "History", plot_title = "B. Priming Pro-Franco Statements", range = 0.54)

> #### A.2.6 Mediation ####
> # NOTE: not looking at interaction with mediation (gets severely underpowered)...
> # just looking at subset treated with Vox statement
> # Examine split with moderates and extreme right (most interesting findings from the results section... 
> # driving later analysis choices [note: re-specifying with full subset, approaching sig with ACME])
> set.seed(1234)

> ### More moderate respondents
> med1 <- subset(data, data$treat %in% c(4:5) & data$ideology<8)

> med1$sympathy <- scale(med1$sympathy)

> ### 1. Is there discounting for Vox's anti-LGBT statements?
> #fit model where treatment predicts mediator
> med.fit <- lm(M2.VoxHostile ~ normal , data = med1) # significant in a 1 tail test)

> #fit model predicting outcome based on treatment and mediator
> out.fit <- lm(sympathy ~ M2.VoxHostile + normal, data = med1)

> #simulation to calculate average causal mediation effect
> med.out <- mediate(med.fit, out.fit, boot = TRUE, treat = "normal", mediator = "M2.VoxHostile", sims = 1000)

> summary(med.out)

Causal Mediation Analysis 

Nonparametric Bootstrap Confidence Intervals with the Percentile Method

               Estimate 95% CI Lower 95% CI Upper p-value    
ACME             0.1165       0.0124         0.22   0.022 *  
ADE              0.1519       0.0346         0.27   0.020 *  
Total Effect     0.2684       0.1094         0.42  <2e-16 ***
Prop. Mediated   0.4341       0.0822         0.83   0.022 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Sample Size Used: 605 


Simulations: 1000 


> #Add results to table
> med_results <- cbind(as.data.frame(t(as.matrix(data.frame(
+   ACME = c( 0.1165, 0.0124, 0.22) , ADE = c(0.1519, 0.0346, 0.27) ,  `Total Effect` = c(0.2684, 0.1094, 0.42),
+   row.names = c("Estimate", "CI_low", "CI_high") )))), Coefs = c("ACME", "ADE", "Total Effect"),
+   group = rep("Moderates", 3))

> #test sensitivity of rho parameter
> sens.out <- medsens(med.out, rho.by = 0.05, effect.type = "indirect",
+                     sims = 1000)

> summary(sens.out) #rho at which ACME goes to 0: -0.65

Mediation Sensitivity Analysis for Average Causal Mediation Effect

Sensitivity Region

       Rho    ACME 95% CI Lower 95% CI Upper R^2_M*R^2_Y* R^2_M~R^2_Y~
[1,] -0.70 -0.0108      -0.0250       0.0035       0.4900       0.2646
[2,] -0.65  0.0054      -0.0060       0.0169       0.4225       0.2281
[3,] -0.60  0.0191      -0.0011       0.0393       0.3600       0.1944

Rho at which ACME = 0: -0.65
R^2_M*R^2_Y* at which ACME = 0: 0.4225
R^2_M~R^2_Y~ at which ACME = 0: 0.2281 


> #plot sensitivity (FIGURE A9b)
> plot(sens.out, sens.par = "rho", main = "Sensitivity for Discounting Mechanism (Moderate sub-sample)", 
+      ylim = c(-0.5, 0.5), xlim = c(-0.9, 0.2))

> ### More Extreme Respondents
> med1 <- subset(data, data$treat %in% c(4:5) & data$ideology>7)

> med1$sympathy <- scale(med1$sympathy)

> ### 1. Is there discounting for Vox's anti-LGBT statements?
> #fit model where treatment predicts mediator
> med.fit <- lm(M2.VoxHostile ~ normal , data = med1) # significant in a 1 tail test)

> #fit model predicting outcome based on treatment and mediator
> out.fit <- lm(sympathy ~ M2.VoxHostile + normal, data = med1)

> #simulation to calculate average causal mediation effect
> med.out <- mediate(med.fit, out.fit, boot = TRUE, treat = "normal", mediator = "M2.VoxHostile", sims = 1000)

> summary(med.out)

Causal Mediation Analysis 

Nonparametric Bootstrap Confidence Intervals with the Percentile Method

               Estimate 95% CI Lower 95% CI Upper p-value
ACME             0.0293      -0.1054         0.17    0.68
ADE              0.0326      -0.1770         0.25    0.76
Total Effect     0.0619      -0.1928         0.33    0.63
Prop. Mediated   0.4738      -5.4466         5.46    0.56

Sample Size Used: 259 


Simulations: 1000 


> #Add results to table
> med_results2 <- cbind(as.data.frame(t(as.matrix(data.frame(
+   ACME = c(0.0293, -0.1054, 0.17) , ADE = c(0.0326, -0.1770, 0.25) ,  `Total Effect` = c(0.0619, -0.1928, 0.33),
+   row.names = c("Estimate", "CI_low", "CI_high") )))), Coefs = c("ACME", "ADE", "Total Effect"),
+   group = rep("Far Right", 3))

> #test sensitivity of rho parameter
> sens.out <- medsens(med.out, rho.by = 0.05, effect.type = "indirect",
+                     sims = 1000) #rho at which ACME goes to 0: -0.55

> #plot sensitivity (Not shown, bc no unobserved confounding needed to render insignificant)
> # e.g., already insignificant ACME
> plot(sens.out, sens.par = "rho", main = "Sensitivity for Discounting Mechanism (Far Right Respondents)", 
+      ylim = c(-0.5, 0.5), xlim = c(-0.9, 0.2))

> #bind mediation results for moderates and extremists (show on one plot)
> med <- rbind(med_results, med_results2)

> #Plot mediation coefficients (FIGURE A9a)
> ggplot(data = med, aes(x = Estimate, y = Coefs, color = group)) +
+   geom_pointrange(aes(xmin = CI_low, xmax = CI_high), 
+                   size = 0.8, linewidth = 2,
+                   position = position_dodge(width = -1/2)) +
+   geom_vline(xintercept = 0, linetype = "dashed") +
+   scale_color_manual(values = c("black", "darkgrey"))+
+   
+   labs(y = "", x = "Standardized estimate", title = "Mediation effects, discounting mechanism") +
+   scale_y_discrete(limits = rev) + scale_x_continuous(limits = c(-0.2, 0.5), breaks = seq(-0.2, 0.4, 0.2)) +
+   theme_bw() +
+   theme(plot.title = element_text(size = 16),
+         legend.text = element_text(size = 12),
+         legend.title = element_blank(),
+         legend.position = "bottom",
+         axis.text = element_text(size = 14),
+         axis.title.x = element_text(size = 14))

> #### A.2.7 Heterogeneous effects, demographics ####
> 
> ### Figure A10, LGBTQ (render at 2000 x 2000)
> gender <- het_splits(subset(data, data$sex == 0),subset(data, data$sex == 1), 
+                      "Women", "Men",issue = "LGBTQ", plot_title = "Gender")

> age <- het_splits(subset(data, data$age>52.1),subset(data, data$age <51.1), 
+                   "Over 51", "51 or younger", issue = "LGBTQ", plot_title = "Age") +
+   theme(axis.text.y = element_blank(), axis.ticks.y = element_blank())

> income <- het_splits(subset(data, data$income > 6.01 ), subset(data, data$income < 6.01), 
+                      "Income > 2500 Euro/month", "Income < 2500 Euro/month", issue = "LGBTQ", plot_title = "Income")

> sp_id <- het_splits(subset(data, data$SP_nationalism > 8.3 ), subset(data, data$income < 8.3), 
+                     "High Sp.ID (9:10)", "Low Sp.ID (<9)", issue = "LGBTQ", plot_title = "Spanish Nationalism") +
+   theme(axis.text.y = element_blank(), axis.ticks.y = element_blank())

> ccaa_id <- het_splits(subset(data, data$CCAA_nationalism > 8.3 ),subset(data, data$CCAA_nationalism < 8.3),
+                       "High CCAA.ID (9:10)", "Low CCAA.ID (<9)", issue = "LGBTQ", plot_title = "Regional Identification")

> pol_k <- het_splits(subset(data, data$pol_know == 1),subset(data, data$pol_know != 1), 
+                     "Correct", "Incorrect", issue = "LGBTQ", plot_title = "Political Knowledge") +
+   theme(axis.text.y = element_blank(), axis.ticks.y = element_blank())

> gender + age + income + sp_id + ccaa_id + pol_k + plot_layout(ncol = 2)

> ### Figure A11, HISTORY (render at 2000 x 2000)
> gender <- het_splits(subset(data, data$sex == 0),subset(data, data$sex == 1), 
+                      "Women", "Men", issue = "History", plot_title = "Gender")

> age <- het_splits(subset(data, data$age>52.1),subset(data, data$age <51.1), 
+                   "Over 51", "51 or younger", issue = "History", plot_title = "Age")+
+   theme(axis.text.y = element_blank(), axis.ticks.y = element_blank())

> income <- het_splits(subset(data, data$income > 6.01 ), subset(data, data$income < 6.01), 
+                      "Income > 2500 Euro/month", "Income < 2500 Euro/month", issue = "History", plot_title = "Income")

> sp_id <- het_splits(subset(data, data$SP_nationalism > 8.3 ),subset(data, data$income < 8.3), 
+                     "High Sp.ID (9:10)", "Low Sp.ID (<9)", issue = "History", plot_title = "Spanish Nationalism")+
+   theme(axis.text.y = element_blank(), axis.ticks.y = element_blank())

> ccaa_id <- het_splits(subset(data, data$CCAA_nationalism > 8.3 ), subset(data, data$CCAA_nationalism < 8.3), 
+                       "High CCAA.ID (9:10)", "Low CCAA.ID (<9)", issue = "History", plot_title = "Regional Identification")

> pol_k <- het_splits(subset(data, data$pol_know == 1),subset(data, data$pol_know != 1), 
+                     "Correct", "Incorrect", issue = "History", plot_title = "Political Knowledge")+
+   theme(axis.text.y = element_blank(), axis.ticks.y = element_blank())

> gender + age + income + sp_id + ccaa_id + pol_k + plot_layout(ncol = 2)

> #### A.3 Vox ideological profile ####
> 
> #Read in manifesto project data
> dat <- read_dta("additional_data/MPDataset_MPDS2023a_stata14.dta", encoding = 'UTF-8')

> ## FIGURE A12a (within Spain comparison)
> dat <- dat[dat$countryname=="Spain",]

> dat <- dat[dat$partyabbrev=="VOX" | dat$partyabbrev=="C's" | dat$partyabbrev=="PSOE" | dat$partyabbrev=="PP" | dat$partyabbrev=="IU" | dat$partyabbrev=="UP", ]

> manifestoSpain <- dat[dat$countryname=="Spain" & dat$coderyear>2016,] %>%
+   ggplot(aes(x = rile, y = per603, colour= partyabbrev))+
+   geom_jitter(alpha=1, aes(size = pervote)) +
+   geom_text(data = dat[dat$edate=="2019-11-10",], aes(label=partyabbrev), size=6, vjust = -.9, hjust = .7, family= "serif") +
+   labs(x="Left-right scale",
+        y="Traditional\nmorality") +
+   scale_colour_manual(name = "Political parties:", 
+                       values = c("orange", "purple", "lightblue", "red", "green")) +
+   theme_bw(base_size = 17) +
+   theme(text = element_text(family="serif"), panel.grid = element_blank(), 
+         axis.title.y = element_text(angle = 0), legend.position = "none")

> ## FIGURE A12b (across far right party comparison)
> #Re-read data for radical right subset
> dat <- read_dta("additional_data/MPDataset_MPDS2023a_stata14.dta", encoding = 'UTF-8')

> dat <- dat[dat$parfam==70,]

> dat$year=substr(dat$edate,1,4)

> dat$vox <- ifelse(dat$partyabbrev=="VOX", 1, 0)

> dat$vox <- factor(dat$vox, levels = c(0,1), labels = c("Other far-right parties", "Vox"))

> manifestoFarRight <- dat[dat$coderyear>2010,] %>%
+   ggplot(aes(x = rile, y = per603, colour= vox))+
+   geom_jitter(alpha=1, aes(size = pervote)) +
+   geom_text(data = dat[dat$year>2016 & dat$year<2020,], aes(label=partyabbrev), size=6, vjust = -.9, hjust = .7, family= "serif") +
+   labs(x="Left-right scale",
+        y="Traditional\nmorality") +
+   scale_colour_manual(values = c("gray", "black")) +
+   theme_bw(base_size = 17) +
+   theme(text = element_text(family="serif"), panel.grid = element_blank(), 
+         axis.title.y = element_text(angle = 0), legend.position = "none")

> ## Figure A12 (render at 1350 x 600)
> manifestoSpain + manifestoFarRight
